//2009/08/24 00:35:48
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class MirroredClock
{
public:
    string whatTimeIsIt(string time)
    {
		int a, b;
		char c;
		sscanf(time.c_str(), "%d%c%d", &a,&c,&b);
		int e = (60 - b) % 60;
		
		int d = (12 - a - (e+b)/60 ) % 12;
		char s[5];
		sprintf(s, "%.2d%c%.2d", d,c,e);
		return s;
    }
};
